package com.bidcms.util;

import java.util.List;

import freemarker.template.SimpleScalar;
import freemarker.template.TemplateMethodModelEx;
import freemarker.template.TemplateModelException;

public class View2Url implements TemplateMethodModelEx {
	public Object exec(List args) throws TemplateModelException {
		SimpleScalar arg1;
		SimpleScalar arg2 =new SimpleScalar("index");
		switch (args.size()) {
		case 0:
			arg1 = new SimpleScalar("showcase");
			arg1 = new SimpleScalar("index");
			break;
		case 1:
			arg1 =  (SimpleScalar) args.get(0);
			arg2 = new SimpleScalar("index");
			break;
		case 2:
			arg1 = (SimpleScalar) args.get(0);
			arg2 =(SimpleScalar) args.get(1);
			break;
		default:
			arg1 = new SimpleScalar("showcase");
			arg1 = new SimpleScalar("index");
			break;
		}
		return "index?con="+arg1+"&act="+arg2;
	}
}
